<script type="text/javascript">
function auto_search(url_search)
{
    var key_search = $("#key_search").val();
    $.ajax({
        type: "POST",
        url: "<?php echo base_url()?>"+url_search,
        data: {key_search:key_search,field_search:$("#field_search").val(),type:"ajax"},
        cache: false,
        dataType: "html",
        success: function(data){
            $("#tbl_file_search").html(data);
        }
    });
}
function insert(file)
{
  $("#<?php echo $rt_tag?>", top.document).val(file);
  $("#<?php echo $rt_tag?>", top.document).change();
  parent.$.fn.colorbox.close();
}
</script>
<div class="media-upload-header">
    <ul id="menu">
        <li><a href="<?php echo base_url()?>index.php/filemanager/index_new/<?php echo $dir_folder;?>/<?php echo $rt_tag?>" <?if($current_tab=='index_new'){echo ' class="current"';}?>><?php echo lang('library');?></a></li>
        <li><a href="<?php echo base_url()?>index.php/filemanager/upload_new/<?php echo $dir_folder;?>/<?php echo $rt_tag?>" <?if($current_tab=='upload_new'){echo ' class="current"';}?>><?php echo lang('upload_file');?></a></li>
    </ul>
</div>
<div style="padding: 20px;height: 350px; overflow: auto;">
    <div style="text-align: center;width: 100%;" class="image_search_bar"><?php echo $search_bar;?></div>
    <div id="tbl_file_search">
        <br/>
        <table class="site">
            <tr>
                <td>Image</td>
                <td>Title</td>
                <td>File name</td>
                <td>Choose file</td>
                <td>Description</td>
            </tr>
            <?
            foreach($list as $rs):
           // $img = explode('/',$rs->lb_url);
            ?>
                <tr>
                    <td>
                        <a id="cboxClose" href="javascript:;" onclick="insert('<?php echo $rs->lb_name?>');"><?php echo $this->icon_library->loadtypefile($rs->lb_url,$rs->lb_ext)?></a>
                    </td>
                    <td><a id="cboxClose" href="javascript:;" onclick="insert('<?php echo $rs->lb_name?>');"><?php echo $rs->lb_title;?></a></td>
                    <td>
                        <a id="cboxClose" href="javascript:;" onclick="insert('<?php echo $rs->lb_name?>');"><?php echo $rs->lb_name?></a>
                    </td>
                    <td style="width: 120px;font-weight: bold;">
                        <a id="cboxClose" href="javascript:;" onclick="insert('<?php echo $rs->lb_name?>');"><?php echo lang('choose_file');?></a>
                    </td>
                    <td><a id="cboxClose" href="javascript:;" onclick="insert('<?php echo $rs->lb_name?>');"><?php echo $rs->description;?></a></td>
                </tr>
            <?php endforeach;?>
        </table>
        <div class="pages"><?php echo $pagination?></div>
    </div>
</div>